;;; -*- Mode: Midas -*-
;;; Copyright (c) 1999 Massachusetts Institute of Technology
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;; published by the Free Software Foundation; either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;;; General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, see https://gnu.org/licenses or
;;; write to:
;;;  Free Software Foundatiom, Inc.
;;;  51 Franklin St, Fifth Floor
;;;  Boston, MA 02110-1301
;;;  USA

.AUXIL

;;; Canonical symbol definition macro, FOO==BAR with error check.
IFNDEF DEFSYM,[	
DEFINE DEFSYM X/
IRPS Z,,[X]
IFNDEF Z,X
.ELSE [	$$TEM1==Z
	X
	IFN Z-$$TEM1,.ERR Z MULTIPLY .QUOTE`.QUOTE/DEFINED/`
      ]
.ISTOP
TERMIN TERMIN
$$TEMP==1
] ;IFNDEF DEFSYM
.ELSE, $$TEMP==0

; Junk for Interlan NI1010A Unibus Ethernet Interface

;Interrupt information
DEFSYM	%ILVEC==300		;Input side interrupt vector (non-standard)
				;Output side assumed to be %LHVEC+4
DEFSYM	%ILPRI==5		;Interrupt priority (should be 6, but
				; hard to change to anything but 4!)

DEFSYM	%ILBAS==764000		;Base of NI1010A Registers in UB space

;Unibus Registers
DEFSYM	%ILCSR=:%ILBAS		;Control and Status Register
DEFSYM	%ILBAR=:%ILBAS+2	;Buffer Address Register
DEFSYM	%ILBCR=:%ILBAS+4	;Byte COunt Register

;Bitz
;CSR bits
DEFSYM	%ILEUA==:140000		;Extended UB address field
DEFSYM	%ILCMD==:37400		;Command Function Code
DEFSYM	%ILCD==:200		;Command Done
DEFSYM	%ILCIE==:100		;Command Interrupt Enable
DEFSYM	%ILRD==:40		;Receive DMA done
DEFSYM	%ILRIE==:20		;Receive Interrupt Enable
DEFSYM	%ILSTS==:17		;Command Status Code

;Commands (in %ILCMD field of CSR)
DEFSYM	%ILSML==400		;Module Loopback (through interface)
DEFSYM	%ILSIL==1000		;Set Internal Loopback
DEFSYM	%ILCLM==1400		;Clear loopback mode
DEFSYM	%ILSPR==2000		;Promiscuous Receive Mode
DEFSYM	%ILCPR==2400		;Clear Promiscuous Receive Mode
DEFSYM	%ILSRE==3000		;Set Receive-on-error bit
DEFSYM	%ILCRE==3400		;Clear Receive-on-error bit
DEFSYM	%ILOFL==4000		;Go Offline
DEFSYM	%ILONL==4400		;Go Online
DEFSYM	%ILROD==5000		;Run onboard diagnostics
DEFSYM	%ILSIS==6000		;Set Insert-source-address mode
DEFSYM	%ILCIS==7000		;Clear Insert-source-address mode
DEFSYM	%ILDPA==7400		;Set physical address to default
DEFSYM	%ILSRM==10000		;Receive all multicast packets
DEFSYM	%ILCRM==10400		;Clear Receive all multicast packets
DEFSYM	%ILRRS==14000		;Report and reset statistics
DEFSYM	%ILRCD==14400		;Report Collision Delay Times
DEFSYM	%ILRCV==20000		;Supply Receive Buffer
DEFSYM	%ILLXD==24000		;Load Transmit Data
DEFSYM	%ILLXS==24400		;Load Transmit Data and Send
DEFSYM	%ILLGA==25000		;Load Group Addreses
DEFSYM	%ILDGA==25400		;Delete Group Adresses
DEFSYM	%ILLPA==26000
DEFSYM	%ILFRQ==30000		;Flush Receive BAR/BCR Queue
DEFSYM	%ILRST==37400		;Reset

;Error codes. Found in %ILSTS field of CSR
DEFSYM 	%ILEOK==0		;Success
DEFSYM	%ILERT==1		;Success, with retries
DEFSYM	%ILEBC==2		;Illegal Command
DEFSYM	%ILEIC==3		;Invalid Command
DEFSYM	%ILERE==4		;Receiver Error
DEFSYM	%ILEBB==5		;Buffer Size Too Big
DEFSYM	%ILEFS==6		;Frams Size Too Small
DEFSYM	%ILEEC==10		;Excessive Collisions
DEFSYM	%ILEBA==12		;Buffer Not Word Aligned
DEFSYM	%ILENX==17		;Non-eXistant Memory

;Diagnostic codes. Results from %ILROD command
DEFSYM	%ILDOK==0		;No Problem
DEFSYM	%ILDCE==1		;ROM/RAM Checksum Error
DEFSYM	%ILDDE==2		;DMA Circuitry Failed
DEFSYM	%ILDXE==3		;Transmit Circuitry Failed
DEFSYM	%ILDRE==4		;Receive Circuitry Failed
DEFSYM	%ILDLE==5		;Loopback checks failed

;Frame status bits, returned in frame status byte
;  at the top of each received packet.
DEFSYM	%ILFCE==1		;CRC Error in packet
DEFSYM	%ILFAE==2		;Alignment Error
DEFSYM	%ILFFL==4		;1+ frames lost just before

IFN $$TEMP,EXPUNG DEFSYM
